import 'package:inmotion_pro/routes/app_routes.dart';
import 'package:get/get.dart';
import 'dart:developer' as developer;

class ControllerObserverMiddleware extends GetMiddleware {
  @override
  GetPageBuilder? onPageBuildStart(GetPageBuilder? page) {
    // 获取即将显示的页面路由信息
    final route = Get.routing.current;

    // 判断是否是目标Controller将要显示
    if (route == AppRoutes.MINE) {
      developer.log('✅✅✅TargetController 即将显示', name: 'ControllerObserver');
      // 可以在这里预加载数据等操作
    }
    return super.onPageBuildStart(page);
  }
}
